<?php
/**
 * Created by PhpStorm.
 * User: 伟鑫
 * Date: 2019/3/14
 * Time: 10:50
 */

namespace app\index\model;


use think\Model;

class WeixiouModel extends Model
{
    protected $name = 'weixiou';

    public function hasoerder(){
        $where = [];
        $type = input('type')?input('type'):0;
        if (!empty($type)){
            $where['a.type']=$type;
        }
        $where['a.userid'] = session('userid');
        return $this->alias('a')->join('orders b','a.orderid = b.order_mun')->where($where)->field('a.type as types, b.*') ->order('a.id desc')->paginate(10);
    }

}